/**
 * This file is part of the CAKIS project.
 * 
 * Copyright (c) 2009-2010 - Florian Arndt, Christian Kerl
 * 
 * @license GNU Lesser General Public License v3 <http://www.opensource.org/licenses/lgpl-3.0.html>
 * @since   01.03.2010
 * @version SVN: $Id: ProductService.java 76 2010-04-11 17:49:32Z christian-kerl@web.de $
 */

package org.cakis.server.service;

import java.util.List;

import org.cakis.server.model.Product;
import org.cakis.server.model.StockUnit;

public interface ProductService {

    /**
     * 
     * 
     * @return
     */
    List<StockUnit> getAllStockUnits();

    /**
     * 
     * 
     * @param id
     * 
     * @return
     * 
     * @throws ProductNotFoundException
     */
    Product getProduct(Long id) throws ProductNotFoundException;

    /**
     * Gets the product information for the given EAN number. If no information is found in the local database
     * this method might query multiple {@link ProductLookupService} implementations.
     * 
     * @param ean An EAN-8 or EAN-13 number identifying the product.
     * 
     * @return The product information.
     * 
     * @throws ProductNotFoundException If no information for the given EAN number could be found.
     * @throws StockUnitNotFoundException
     */
    Product getProduct(String ean) throws ProductNotFoundException, StockUnitNotFoundException;

    /**
     * 
     * 
     * @param product
     * 
     * @return
     * 
     * @throws IllegalArgumentException
     * @throws StockUnitNotFoundException
     */
    Product addProduct(Product product) throws IllegalArgumentException, StockUnitNotFoundException;

    @javax.ejb.Local
    public static interface Local extends ProductService {
    }

    @javax.ejb.Remote
    public static interface Remote extends ProductService {
    }
}
